package com.yixun.qfbao.xf.model.enums;

import org.apache.commons.lang.StringUtils;

public enum PremisesImageEnum {
	// 1.楼盘封面图 2.户型图 3.样板间 4.效果图 5.小区配套 6，实景图 7.项目现场 60 营业执照 70，分销合同 80 预售许可证 90
	// 开发商授权书

	PREMISES_IMAGE_1("1", "楼盘封面图"), 
	PREMISES_IMAGE_2("2", "户型图"), 
	PREMISES_IMAGE_3("3", "样板间"), 
	PREMISES_IMAGE_4("4","效果图"), 
	PREMISES_IMAGE_5("5", "小区配套"), 
	PREMISES_IMAGE_6("6", "实景图"), 
	PREMISES_IMAGE_7("7","项目现场"), 
	PREMISES_IMAGE_60("60", "营业执照"), 
	PREMISES_IMAGE_70("70","分销合同"), 
	PREMISES_IMAGE_80("80", "预售许可证"), 
	PREMISES_IMAGE_90("90", "开发商授权书"),
	
	//楼盘资料中的类型 add by zilong.liu
	PREMISES_FILE_WORD("8", "word"),
	PREMISES_FILE_EXCEL("9", "excel"),
	PREMISES_FILE_PPT("10", "ppt"),
	PREMISES_FILE_IMAGE("11", "图片文件"),
	PREMISES_FILE_PDF("12", "pdf"),
	PREMISES_FILE_ZIP("13", "压缩文件");
	//楼盘资料中的类型 add by zilong.liu

	
	private String code;

	private String name;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private PremisesImageEnum(String code, String name) {
		this.code = code;
		this.name = name;
	}

	public static PremisesImageEnum getByNo(String code) {
		if (StringUtils.isBlank(code)) {
			return null;
		}
		for (PremisesImageEnum menum : values()) {
			if (menum.getCode().equals(code)) {
				return menum;
			}
		}
		return null;
	}
	
	public static String getDesByNo(String code) {
		for (PremisesImageEnum premisesImageEnum : PremisesImageEnum.values()) {
			if(code.equals(premisesImageEnum.getCode())) {
				return premisesImageEnum.getName();
			}
		}
		return "";
	}

}
